package com.sdppf.action;

import com.sdppf.service.PageContentService;


/**
 * 分页内容
 * @author ZXJ jimantou@gmail.com
 *
 */
public class APageContentAction<T> {
	@SuppressWarnings("unchecked")
	public String execute() throws ClassNotFoundException{
		this.type = (Class<T>)Class.forName("com.sdppf.domain."+tableName);
		System.out.println(this.pageIndex);
		this.developers = this.pageContentService.GetPageList(pageIndex, tableName, pageContainNumber);
		return returnPage;
	}
	private int pageIndex;
	public int getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}
	
	private Class<T> type;
	public Class<T> getType() {
		return type;
	}

	public void setType(Class<T> type) {
		this.type = type;
	}
	
	public Iterable<T> developers;
	public Iterable<T> getDevelopers() {
		return developers;
	}

	public void setDevelopers(Iterable<T> developers) {
		this.developers = developers;
	}
	
	private PageContentService<T> pageContentService;
	public PageContentService<T> getPageContentService() {
		return pageContentService;
	}

	public void setPageContentService(PageContentService<T> pageContentService) {
		this.pageContentService = pageContentService;
	}
	
	private int pageContainNumber;
	public int getPageContainNumber() {
		return pageContainNumber;
	}

	public void setPageContainNumber(int pageContainNumber) {
		this.pageContainNumber = pageContainNumber;
	}
	
	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}
	private String tableName;
	
	private String returnPage;
	public String getReturnPage() {
		return returnPage;
	}

	public void setReturnPage(String returnPage) {
		this.returnPage = returnPage;
	}
}
